package com.example.feign.fallback;

import com.example.dto.BusinessUserDTO;
import com.example.dto.SysUserDTO;
import com.example.feign.UsernameFeignClient;
import com.example.model.api.Result;
import com.example.security.UserDetail;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.Map;


/**
 * 用户接口 FallbackFactory
 *
 * @author Mark sunlightcs@gmail.com
 */
@Slf4j
@Component
public class UsernameFeignClientFallbackFactory implements FallbackFactory<UsernameFeignClient> {
    @Override
    public UsernameFeignClient create(Throwable throwable) {
        return new UsernameFeignClient() {


            @Override
            public Result<UserDetail> getByUsername(String username) {
                return null;
            }

            @Override
            public Result<UserDetail> getByBusinessUsername(String username) {
                return null;
            }

            @Override
            public Result<Integer> getIsBusiness(String id) {
                return null;
            }

            @Override
            public Result<BusinessUserDTO> businessUsernameExist(String username) {
                return null;
            }

            @Override
            public Result<String> createBusinessUser(Map<String, Object> params) {
                return null;
            }

            @Override
            public Result<SysUserDTO> getSysUsername(String username) {
                return null;
            }

            @Override
            public Result saveThirdOauth2(SysUserDTO dto) {
                return null;
            }
        };
    }
}
